package com.clarte.user.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.clarte.model.User;
import com.clarte.user.service.UserService;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope("prototype")
public class UserListAction extends ActionSupport {
	
	@Resource(name="userService")
	private UserService userService;
	private List<User> users;
	
	@Action(value="userList",results={
		@Result(location="user/userList.jsp")
	})
	public String execute(){
		return this.SUCCESS;
	}
	
	@Action(value="listJson",results={
		@Result(type="json")
	})
	public String listJson(){
		
		return this.SUCCESS;
	}
	
	public List<User> getUsers() {
		return users;
	}
	
}
